home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 15 / CU Amiga Magazine's Super CD-ROM 15 (1997)(EMAP Images)(GB)[!][issue 1997-10].iso / CUCD / Graphics / Ghostscript / source / gxclio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-26  |  3.0 KB  |  86 lines

  1. /* Copyright (C) 1995, 1997 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* gxclio.h */
  20. /* I/O interface for command lists */
  21.  
  22. #ifndef gxclio_INCLUDED
  23. #  define gxclio_INCLUDED
  24.  
  25. /*
  26.  * There are two implementations of the I/O interface for command lists --
  27.  * one suitable for embedded systems, which stores the "files" in RAM, and
  28.  * one suitable for other systems, which uses an external file system --
  29.  * with the choice made at compile/link time.  This header file defines the
  30.  * API between the command list code proper and its I/O interface.
  31.  */
  32.  
  33. typedef void *clist_file_ptr;    /* We can't do any better than this. */
  34.  
  35. /* ---------------- Open/close/unlink ---------------- */
  36.  
  37. /*
  38.  * If *fname = 0, generate and store a new scratch file name; otherwise,
  39.  * open an existing file.  Only modes "r" and "w+" are supported,
  40.  * and only binary data (but the caller must append the "b" if needed).
  41.  * Mode "r" with *fname = 0 is an error.
  42.  */
  43. int clist_fopen(P5(char *fname, const char *fmode, clist_file_ptr *pcf,
  44.            gs_memory_t *mem, bool ok_to_compress));
  45.  
  46. /*
  47.  * Close a file, optionally deleting it.
  48.  */
  49. int clist_fclose(P3(clist_file_ptr cf, const char *fname, bool delete));
  50.  
  51. /*
  52.  * Delete a file.
  53.  */
  54. int clist_unlink(P1(const char *fname));
  55.  
  56. /* ---------------- Writing ---------------- */
  57.  
  58. /* clist_space_available returns min(requested, available). */
  59. long clist_space_available(P1(long requested));
  60.  
  61. int clist_fwrite_chars(P3(const void *data, uint len, clist_file_ptr cf));
  62.  
  63. /* ---------------- Reading ---------------- */
  64.  
  65. int clist_fread_chars(P3(void *data, uint len, clist_file_ptr cf));
  66.  
  67. /* ---------------- Position/status ---------------- */
  68.  
  69. /* clist_ferror_code returns an error code per gserrors.h, not a Boolean. */
  70. int clist_ferror_code(P1(clist_file_ptr cf));
  71.  
  72. long clist_ftell(P1(clist_file_ptr cf));
  73.  
  74. /*
  75.  * We pass the file name to clist_rewind and clist_fseek in case the
  76.  * implementation has to close and reopen the file.  (clist_fseek with
  77.  * offset = 0 and mode = SEEK_END indicates we are about to append.)
  78.  */
  79. void clist_rewind(P3(clist_file_ptr cf, bool discard_data,
  80.              const char *fname));
  81.  
  82. int clist_fseek(P4(clist_file_ptr cf, long offset, int mode,
  83.            const char *fname));
  84.  
  85. #endif                    /* gxclio_INCLUDED */
  86.